﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using DuncanDAL;

namespace BLL.PayRecordsTransaction
{
    public class DeletePayRecordsTransaction:ICommand
    {
        public DeletePayRecordsTransaction(int _PayRecordOID)
        {
            oid = _PayRecordOID;
        }

        private int oid;

        public bool Result
        {
            get;
            set;
        }

        #region ICommand 成员

        public void Execute()
        {
            try
            {
                PayRecordsDataService objPayRecordsDataService = new PayRecordsDataService();
                Model.T_PayRecordsObject o=new Model.T_PayRecordsObject();
                o.Db_OID = oid;
                objPayRecordsDataService.Delete(o);
                Result = true;
            }
            catch (SqlException e)
            {
                throw e;
            }
        }

        #endregion
    }
}
